/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.openbrew.openbrewrf;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author dchapman
 */
@Entity
@Table(name = "CostSettings")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CostSettings.findAll", query = "SELECT c FROM CostSettings c"),
    @NamedQuery(name = "CostSettings.findByCsid", query = "SELECT c FROM CostSettings c WHERE c.csid = :csid"),
    @NamedQuery(name = "CostSettings.findByAvgEmpPay", query = "SELECT c FROM CostSettings c WHERE c.avgEmpPay = :avgEmpPay"),
    @NamedQuery(name = "CostSettings.findByAvgWaterPerBBL", query = "SELECT c FROM CostSettings c WHERE c.avgWaterPerBBL = :avgWaterPerBBL"),
    @NamedQuery(name = "CostSettings.findByWaterCost", query = "SELECT c FROM CostSettings c WHERE c.waterCost = :waterCost"),
    @NamedQuery(name = "CostSettings.findByOverheadPerBBL", query = "SELECT c FROM CostSettings c WHERE c.overheadPerBBL = :overheadPerBBL"),
    @NamedQuery(name = "CostSettings.findByPctMaterialUpcharge", query = "SELECT c FROM CostSettings c WHERE c.pctMaterialUpcharge = :pctMaterialUpcharge")})
public class CostSettings implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "csid")
    private Integer csid;
    @Basic(optional = false)
    @NotNull
    @Column(name = "avgEmpPay")
    private float avgEmpPay;
    @Basic(optional = false)
    @NotNull
    @Column(name = "avgWaterPerBBL")
    private float avgWaterPerBBL;
    @Basic(optional = false)
    @NotNull
    @Column(name = "waterCost")
    private float waterCost;
    @Basic(optional = false)
    @NotNull
    @Column(name = "overheadPerBBL")
    private float overheadPerBBL;
    @Basic(optional = false)
    @NotNull
    @Column(name = "pctMaterialUpcharge")
    private float pctMaterialUpcharge;

    public CostSettings() {
    }

    public CostSettings(Integer csid) {
        this.csid = csid;
    }

    public CostSettings(Integer csid, float avgEmpPay, float avgWaterPerBBL, float waterCost, float overheadPerBBL, float pctMaterialUpcharge) {
        this.csid = csid;
        this.avgEmpPay = avgEmpPay;
        this.avgWaterPerBBL = avgWaterPerBBL;
        this.waterCost = waterCost;
        this.overheadPerBBL = overheadPerBBL;
        this.pctMaterialUpcharge = pctMaterialUpcharge;
    }

    public Integer getCsid() {
        return csid;
    }

    public void setCsid(Integer csid) {
        this.csid = csid;
    }

    public float getAvgEmpPay() {
        return avgEmpPay;
    }

    public void setAvgEmpPay(float avgEmpPay) {
        this.avgEmpPay = avgEmpPay;
    }

    public float getAvgWaterPerBBL() {
        return avgWaterPerBBL;
    }

    public void setAvgWaterPerBBL(float avgWaterPerBBL) {
        this.avgWaterPerBBL = avgWaterPerBBL;
    }

    public float getWaterCost() {
        return waterCost;
    }

    public void setWaterCost(float waterCost) {
        this.waterCost = waterCost;
    }

    public float getOverheadPerBBL() {
        return overheadPerBBL;
    }

    public void setOverheadPerBBL(float overheadPerBBL) {
        this.overheadPerBBL = overheadPerBBL;
    }

    public float getPctMaterialUpcharge() {
        return pctMaterialUpcharge;
    }

    public void setPctMaterialUpcharge(float pctMaterialUpcharge) {
        this.pctMaterialUpcharge = pctMaterialUpcharge;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (csid != null ? csid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CostSettings)) {
            return false;
        }
        CostSettings other = (CostSettings) object;
        if ((this.csid == null && other.csid != null) || (this.csid != null && !this.csid.equals(other.csid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.openbrew.openbrewrf.CostSettings[ csid=" + csid + " ]";
    }
    
}
